<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>菜鸟教程</title>
  </head>
  <body>
    <script type="text/javascript">
      console.log("基本类型的包装类为：String(), Number(),Boolean()");
      var bool1 = new Boolean(true);
      var bool2 = new Boolean(true);
      console.log(bool1 == bool2);

      // 将基本数据类型的数据转换为对象。
      let str1 = "zhangsan";
      let str2 = new String("zhangsan");
      let num = new Number(3);
      let bool = new Boolean(true);
      console.log(typeof str1);
      console.log(typeof str2);
      console.log(typeof num);
      console.log(typeof bool);

      var str = "hahahahhah";
      console.log(str.length);
      console.log(str[2]);
    </script>
  </body>
</html>
